﻿using System.ComponentModel.DataAnnotations;
using Xcj.Mes.WholeLine.DataBase.Common;

namespace Xcj.Mes.WholeLine.DataBase.Entity
{
    public class PlcConfigEntity : BaseEntity
    {
        // 钉卷 组立 老化 座板 其它
        private string _deviceType = string.Empty;
        [Alias("设备类型"), StringLength(32)]
        public string DeviceType
        {
            get => _deviceType;
            set
            {
                _deviceType = value?.Trim();
                RaisePropertyChanged();
            }
        }

        private string _plcBrand = "Panasonic";
        [Alias("Plc品牌"), StringLength(32)]
        public string PlcBrand
        {
            get => _plcBrand;
            set
            {
                _plcBrand = value?.Trim();
                RaisePropertyChanged();
            }
        }

        private string _plcModel = "FP7";
        [Alias("Plc型号"), StringLength(32)]
        public string PlcModel { get => _plcModel; set { _plcModel = value?.Trim(); RaisePropertyChanged(); } }

        private string _plcProtocol = "FP7";
        [Alias("Plc通信协议"), StringLength(32)]
        public string PlcProtocol { get => _plcProtocol; set { _plcProtocol = value?.Trim(); RaisePropertyChanged(); } }

        private string _plcIP = "192.168.1.88";
        [Alias("PlcIP"), StringLength(32)]
        public string PlcIP
        {
            get => _plcIP;
            set
            {
                _plcIP = value?.Trim();
                RaisePropertyChanged();
            }
        }

        private int _plcPort = 6601;
        [Alias("Plc端口")]
        public int PlcPort
        {
            get => _plcPort;
            set
            {
                _plcPort = value;
                RaisePropertyChanged();
            }
        }
    }
}

